
//
//  IntegralChildTableViewCell.m
//  AnXin100
//
//  Created by Sakura on 2018/10/31.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "IntegralChildTableViewCell.h"

@interface IntegralChildTableViewCell ()

@property (nonatomic, strong) UILabel *nameLabel;

@property (nonatomic, strong) UILabel *priceLabel;

@end

@implementation IntegralChildTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    _nameLabel = [UILabel new];
    _nameLabel.textColor = [UIColor colorWithHex:0x333333];
    _nameLabel.font = [UIFont systemFontOfSize:16];
    _nameLabel.text = @"2018.09.09购买商品 +120";
    [self.contentView addSubview:_nameLabel];
    
    _priceLabel = [UILabel new];
    _priceLabel.textColor = [UIColor colorWithHex:0x333333];
    _priceLabel.font = [UIFont systemFontOfSize:16];
    _priceLabel.text = @"+120";
    _priceLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:_priceLabel];
}

- (void)layoutSubviews {
    _nameLabel.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 0)
    .heightIs(self.mj_h)
    .widthIs((SCREEN_WIDTH - 40) / 2);
    
    [self.contentView layoutIfNeeded];
    
    _priceLabel.sd_layout
    .leftSpaceToView(_nameLabel, 20)
    .rightSpaceToView(self.contentView, 10)
    .heightIs(self.mj_h);
}


- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
